package com.wang.test.demo.putong;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.wang.test.demo.entity.Te;
import com.wang.test.demo.entity.UserPojo;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class StringOrList {



    public static void main(String[] args) {

        String s = "AdvancedMetastaticTherapy";
        System.out.println(s.toUpperCase());
        Set<String> list = new HashSet<>();

        list.add("d");
        for (int x = 0; x<3;x++){
            String string = "";
            //if (StringUtils.)
            for (int y= 0;y<2;y++){

            }
        }

        Map<String, String> map = new HashMap<>();
        //map.put("nuhgaoi1111","999");
        JSONObject jsonObject = new JSONObject();
        String string = "ni";
        //Object parse = JSON.parse(string);
        //System.out.println(parse);
        Te te = new Te();
        te.setDate("8080");
        String string1 = JSONObject.toJSONString(te);
        String string2 = JSON.toJSONString(map);

        //mapToJson();


        pojoToJson();
    }

    private static String mapToJson() {
        Map<String,String> map = new HashMap<>();
        map.put("age","18");
        map.put("name","小明");
        map.put("gender","男");
        String string = JSON.toJSONString(map);
        System.out.println(string);
        map.clear();
        String stringNull = JSON.toJSONString(map);
        System.out.println(stringNull);
        return string;
    }
    private static String pojoToJson() {

        UserPojo userPojo = new UserPojo();
        String stringNull = JSON.toJSONString(userPojo);
        System.out.println(stringNull);
        userPojo.setAge("19");
        userPojo.setGender("女");
        userPojo.setName("小红");
        String string = JSON.toJSONString(userPojo);
        System.out.println(string);
        return string;
    }




}
